#ifndef APPLYFRIENDITEM_H
#define APPLYFRIENDITEM_H

#include <QWidget>
#include "userdata.h"
#include <memory>

namespace Ui {
class ApplyFriendItem;
}

class ApplyFriendItem : public QWidget
{
    Q_OBJECT

public:
    explicit ApplyFriendItem(QWidget *parent = nullptr);
    ~ApplyFriendItem();
    void setInfo(std::shared_ptr<ApplyInfo> applyInfo);
    void setAcceptBtnState(bool accepted);
    int getUid();

private:
    Ui::ApplyFriendItem *ui;
    std::shared_ptr<ApplyInfo> _applyInfo;
    bool _accepted;
signals:
    void sig_authFriend(std::shared_ptr<ApplyInfo> applyInfo);

    // QWidget interface
public:
    virtual QSize sizeHint() const override;
    virtual bool eventFilter(QObject *watched, QEvent *event) override;

protected:
    virtual void paintEvent(QPaintEvent *event) override;
private slots:
    void on_apply_accept_btn_clicked();
};

#endif // APPLYFRIENDITEM_H
